/**
 * 定义应用路由
 */
import React from 'react';
import { Provider } from 'react-redux';
import { HashRouter, Switch, Route } from 'react-router-dom';
import HeaderFooterLayout from './layouts/HeaderFooterLayout';
import AsideLayout from './layouts/AsideLayout/index';
import store from './store';

// 按照 Layout 分组路由
// HeaderFooterLayout 对应的路由：/xxx
// AsideLayout 对应的路由：/center/xxx （个人中心）
const router = () => {
  return (
    <Provider store={store}>
      <HashRouter>
        <Switch>
          <Route path="/center" component={AsideLayout} />
          <Route path="/" component={HeaderFooterLayout} />
        </Switch>
      </HashRouter>
    </Provider>
  );
};

export default router();
